import re


html = '''
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<ul>
    <li><a href="www.baidu1.com">链接1</a></li>
    <li><a href="www.baidu2.com">链接2</a></li>
    <li><a href="www.baidu3.com">链接3</a></li>
    <li><a href="www.baidu4.com">链接4</a></li>
    <li><a href="www.baidu5.com">链接5</a></li>
</ul>
</body>
</html>
'''
# result = re.search(r'<title>(.*?)</title>', html).group(1)
# print(result)

result = re.findall(r'<li><a href="(.*?)">(.*?)</a></li>', html)
print(result)
for item in result:
    print(item)
